//接口不用interface修饰 可以把抽象类当做接口使用
//直接使用implement继承接口
//使用接口必须实现抽象类的所有方法和属性

abstract class Animal {
  String animal = "animal";

  eat(); //抽象方法
  drink();

  run() {
    print("run");
  }
}

class Cat implements Animal {
  @override
  drink() {
    print("cat正在喝水");
  }

  @override
  eat() {
    print("cat在吃猫粮");
  }

  @override
  run() {
    // TODO: implement run
  }

  @override
  String animal = "cat";
}

class Dog implements Animal {
  @override
  String animal = "dog";

  @override
  drink() {
    // TODO: implement drink
    throw UnimplementedError();
  }

  @override
  eat() {
    // TODO: implement eat
    throw UnimplementedError();
  }

  @override
  run() {
    // TODO: implement run
    throw UnimplementedError();
  }
}

void main() {
  Cat c = new Cat();
  c.eat();
  c.drink();
  c.run();

  Animal a = new Cat();
  a.run;
}
